package xinxin.com.StatePatternBasic.Context;

import xinxin.com.StatePatternBasic.State.State;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/3/26 10:05
 */
public class Context {
    private State state;

    public Context(State state) {
        this.state = state;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
        System.out.println("当前状态：" + state.getClass().getName());
    }

    public void Request () {
        state.Handle(this);
    }
}
